home *** CD-ROM | disk | FTP | other *** search
/ Mesolore / Mesolore - Disc 2.iso / mac / data / Nuttall.dir / 00020_Script_SingleFrameLoop (cdx) < prev    next >
Text File  |  2001-01-30  |  4KB  |  136 lines

  1. Global gLastPic
  2. Global gShowBalloons, gShowText,gShowOrder
  3. Global gIndex
  4.  
  5. on prepareframe
  6.   set the stagecolor = 255
  7.   if gShowOrder = TRUE then 
  8.     repeat with x = 4 to 7
  9.       set the visible of sprite x = TRUE
  10.     end repeat
  11.   else
  12.     repeat with x = 4 to 7
  13.       set the visible of sprite x = FALSE
  14.     end repeat
  15.   end if
  16.   updatestage
  17. end 
  18.  
  19. on exitFrame
  20.   
  21.   if not rollover(100) and not rollover(101) and not checkRollPanel() then --- 100 is left panel
  22.     if rollover(51) then
  23.       clearballoons "noCursor"
  24.       cursor [48,49]
  25.     else if rollover(52) then
  26.       clearballoons "noCursor"
  27.       cursor [50,51]
  28.     else if rollover(90) then
  29.       clearballoons "noCursor"
  30.       --      cursor 0
  31.     else if rollover(50) then
  32.       clearballoons
  33.     else if rollover(55) then
  34.       --      roll 55
  35.       clearballoons
  36.     else if rollover(56) then
  37.       --      roll 56
  38.       clearballoons
  39.     else 
  40.       cursor 302
  41.       
  42.       
  43.       ---- display balloons ----
  44.       if gShowBalloons = TRUE and the mouseCast <> -1 then
  45.         repeat with x = 45 down to 9
  46.           if sprite(x).member.type = #bitmap and rollover(x)then
  47.             if gLastpic = x then
  48.               exit repeat
  49.             end if
  50.             set the visible of sprite 60 = FALSE
  51.             set the member of sprite 60 = "balloon"
  52.             set the visible of sprite 61 = FALSE
  53.             set the member of sprite 61 = "bluehilite"
  54.             updatestage
  55.             set gLastPic = x
  56.             if the mousecast > 959 then abort
  57.             put findLine(the mouseCast) into field "balloon"
  58.             set the rect of member "balloon" = rect(0,0,400,200)-- set long so lengths ar calculated correctly
  59.             set the rect of member "balloon" = rect(0,0,getLength(),200)
  60.             --- vertical
  61.             if the locv of sprite x <= 240 then
  62.               set the locV of sprite 60 = (the bottom of sprite x) +20
  63.             else
  64.               set the locV of sprite 60 = the top of sprite x - (sprite(60).member.height) -20
  65.             end if
  66.             --- Horizontal
  67.             set over = (the locH of sprite x + the width of the member of sprite 60)
  68.             if over > 640 then
  69.               set the locH of sprite 60 = 640 - the width of the member of sprite 60 -10
  70.             else
  71.               set the locH of sprite 60 = max(10,the locH of sprite x - ((the width of sprite x)/2))
  72.             end if
  73.             if rollover(x) then --- if still rolledOver
  74.            
  75.               if gShowBalloons = TRUE then
  76.                 
  77.                 set the rect of sprite 61 = the rect of sprite x
  78.                 set the visible of sprite 60 = TRUE
  79.                 set the visible of sprite 61 = TRUE
  80.                 updatestage
  81.                 exit repeat
  82.               end if
  83.             end if
  84.           end if 
  85.         end repeat
  86.       end if
  87.     end if
  88.   else
  89.     clearballoons
  90.   end if
  91.   go the frame
  92. end
  93.  
  94. on getLength(what)
  95.   set holder = 0
  96.   set temp = field "balloon"
  97.   repeat with x = 1 to  the number of chars in temp
  98.     holder = max(charPosToLoc(member "balloon",x)[1],holder)
  99.   end repeat
  100.   return holder+10
  101. end
  102.  
  103. on clearballoons which
  104.   --  if voidp(which) then cursor 0
  105.   set the visible of sprite 60 = FALSE
  106.   set the visible of sprite 61 = FALSE
  107.   set gLastpic = ""
  108. end
  109.  
  110. on findLine which
  111.   set the itemdelimiter = ","
  112.   set infoLine = line value(which - 460) of gIndex
  113.   set temp = field ("balloons" & (item 1 of infoline))
  114.   set x = value( item 2 of infoline)
  115.   
  116.   set count = x + 1
  117.   repeat while line count of temp contains "%" = false and line count of temp <> empty
  118.     set count = count + 1
  119.   end repeat
  120.   set info = line (x+1) to count - 1 of temp
  121.   
  122.   return info
  123.   
  124. end
  125.  
  126.  
  127. on clear
  128.   if the memberNum of sprite 55 <> the mousecast then
  129.     unroll 55
  130.   end if
  131.   if the memberNum of sprite 56 <> the mousecast then
  132.     unroll 56
  133.   end if
  134. end
  135.  
  136.